<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<link href="${ctsCss}/layout.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctsJs}/jquery/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="${ctsJs}/Util.js"></script>
<script type="text/javascript" src="${ctsJs}/report.js"></script>
<script type="text/javascript" src="${ctsJs}/ColorPicker/jquery.colorpicker.js"></script>
<script type="text/javascript" src="${ctsJs}/layer/layer.min.js"></script>
<script type="text/javascript" src="${ctsJs}/report-conditions.js"></script>
<script type="text/javascript" src="${ctsJs}/report-cell-conditions.js"></script>
<script type="text/javascript" src="${ctsJs}/report-count.js"></script>
<script type="text/javascript" src="${ctsJs}/report-validation.js"></script>
<style type="text/css"> 
.btn-primary {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #006dcc;
  *background-color: #0044cc;
  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  background-image: linear-gradient(to bottom, #0088cc, #0044cc);
  background-repeat: repeat-x;
  border-color: #0044cc #0044cc #002a80;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
  filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
.btn {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #f5f5f5;
    background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
    background-repeat: repeat-x;
    border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) #a2a2a2;
    border-image: none;
    border-radius: 0;
    border-style: solid;
    border-width: 1px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #333333;
    cursor: pointer;
    display: inline-block;
    font-size: 12px;
    line-height: 20px;
    margin-bottom: 0;
    padding: 1px 10px;
    text-align: center;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
    vertical-align: middle;
}
</style>
<script type="text/javascript">
	var ctx = "${ctx}";
	//控制颜色面板DIV用
	 function DivSetVisible(state)
	  {
	   var DivRef = document.getElementById('colorpanel');
	   var IfrRef = document.getElementById('DivShim');
	   if(state)
	   {
	    DivRef.style.display = "block";
	    IfrRef.style.width = DivRef.offsetWidth;
	    IfrRef.style.height = DivRef.offsetHeight;
	    IfrRef.style.top = DivRef.style.top;
	    IfrRef.style.left = DivRef.style.left;
	    IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	    IfrRef.style.display = "block";
	   }
	   else
	   {
	    DivRef.style.display = "none";
	    IfrRef.style.display = "none";
	   }
	  }
	 //控制行列条件DIV用
	 function DivSetVisibleCond(state)
	  {
	   var DivRef = document.getElementById('pop-up');
	   var IfrRef = document.getElementById('DivShim1');
	   if(state)
	   {
	    DivRef.style.display = "block";
	    IfrRef.style.width = DivRef.offsetWidth;
	    IfrRef.style.height = DivRef.offsetHeight;
	    IfrRef.style.top = DivRef.style.top;
	    IfrRef.style.left = DivRef.style.left;
	    IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	    IfrRef.style.display = "block";
	   }
	   else
	   {
	    DivRef.style.display = "none";
	    IfrRef.style.display = "none";
	   }
	  }
	//控制单元格条件DIV用
	 function DivSetVisibleCellCond(state)
	  {
	   var DivRef = document.getElementById('danyuange');
	   var IfrRef = document.getElementById('DivShim2');
	   if(state)
	   {
	    DivRef.style.display = "block";
	    IfrRef.style.width = DivRef.offsetWidth;
	    IfrRef.style.height = DivRef.offsetHeight;
	    IfrRef.style.top = DivRef.style.top;
	    IfrRef.style.left = DivRef.style.left;
	    IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	    IfrRef.style.display = "block";
	   }
	   else
	   {
	    DivRef.style.display = "none";
	    IfrRef.style.display = "none";
	   }
	  }
	//控制行列计算DIV用
	 function DivSetVisibleCount(state)
	  {
	   var DivRef = document.getElementById('hangliejisuan');
	   var IfrRef = document.getElementById('DivShim3');
	   if(state)
	   {
	    DivRef.style.display = "block";
	    IfrRef.style.width = DivRef.offsetWidth;
	    IfrRef.style.height = DivRef.offsetHeight;
	    IfrRef.style.top = DivRef.style.top;
	    IfrRef.style.left = DivRef.style.left;
	    IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	    IfrRef.style.display = "block";
	   }
	   else
	   {
	    DivRef.style.display = "none";
	    IfrRef.style.display = "none";
	   }
	  }
	
	//行列校核
	 function DivSetVisibleValidation(state)
	  {
	   var DivRef = document.getElementById('hangliejiaohe');
	   var IfrRef = document.getElementById('DivShim4');
	   if(state)
	   {
	    DivRef.style.display = "block";
	    IfrRef.style.width = DivRef.offsetWidth;
	    IfrRef.style.height = DivRef.offsetHeight;
	    IfrRef.style.top = DivRef.style.top;
	    IfrRef.style.left = DivRef.style.left;
	    IfrRef.style.zIndex = DivRef.style.zIndex - 1;
	    IfrRef.style.display = "block";
	   }
	   else
	   {
	    DivRef.style.display = "none";
	    IfrRef.style.display = "none";
	   }
	  }
	
</script>
<script language="javascript" for="DCellWeb" event="MenuStart(c, r, s)">
	DCellWeb.MenuStart(c, r, s)
</script>
<script language="javascript" for="DCellWeb" event="MenuCommand(c,r,itemId)">
	DCellWeb.MenuCommand(c, r, itemId)
</script>
<script language="javascript" for="DCellWeb" event="MouseLClick(c,r,updn)">
	DCellWeb.MouseLClick(c, r, 1)
</script>
</head>
<body>
<input type="hidden" id="notationValueId" name="notationValueName"/>
<input type="hidden" id="templateId" name="templateId" value="${templateId}"/>
<input type="hidden" id="annualId" value="${annualId}"/>
<input type="hidden" id="cllUrl" value="${cllUrl}"/>
<input type="hidden" id="cellTypeJson" name="cellTypeJson" value="${cellTypeJson}"/>

<!-- 用户行列条件设置时，行列的范围 -->
<!-- 列 -->
<input type="hidden" id="condStartColValueHidden" name="condStartColValueHiddenName" value="${condStartCol}"/>
<input type="hidden" id="condEndColValueHidden" name="condEndColValueHiddenName" value="${condEndCol}"/>
<!-- 行 -->
<input type="hidden" id="condStartRowValueHidden" name="condStartRowValueHiddenName" value="${condStartRow}"/>
<input type="hidden" id="condEndRowValueHidden" name="condEndRowValueHiddenName" value="${condEndRow}"/>
	
<!-- 报表数据区域内的行列范围，用作报表计算时候使用 -->
<!-- 列 -->
<input type="hidden" id="absStartColValueHidden" name="absStartColValueHiddenName" value="${absStartCol}"/>
<input type="hidden" id="absEndColValueHidden" name="absEndColValueHiddenName" value="${absEndCol}"/>
<!-- 行 -->
<input type="hidden" id="absStartRowValueHidden" name="absStartRowValueHiddenName" value="${absStartRow}"/>
<input type="hidden" id="absEndRowValueHidden" name="absEndRowValueHiddenName" value="${absEndRow}"/>
  <iframe
  id="DivShim"
  scrolling="no"
  frameborder="0"
  style="position:absolute; display:none;filter=progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);">
 </iframe>
	<div id="center">
	  <div id="left">
	    <ul id="lef_cen">
	      <li id="lef_header">报表设计</li>
	      <li id="lef_tool">
	      	<!-- <input id="upload" type="button" value="保存">
	      	<input type="button" id="fontStyleCu" name="jiacuname" title="加粗">
	      	<input type="button" id="fontStyleXie" name="xiename" title="加斜">
	      	<input type="button" id="fontStyleXia" name="xianame" title="下划线">
	      	<input id="rowCellLeft" type="button" title="居左">
	      	<input id="rowCellCenter" type="button" title="居中">
	      	<input id="rowCellRight" type="button" title="居右">
	      	<input id="insertCellCol" type="button" title="增加列">
			<input id="insertCellRow" type="button" title="增加行">
			<input id="deleteCellCol" type="button" title="删除列">
			<input id="deleteCellRow" type="button" title="删除行">
			<input id="mergeCell" type="button" title="合并单元格">
			<input id="unMergeCell" type="button" title="拆分单元格"> -->
						
			<ul id="gjl">
			<li><a id="saveReportTemplate" href="#" title="保存"></a></li>
			<li><a id="fontStyleCu" href="#" title="加粗"></a></li>
			<li><a id="fontStyleXie" href="#" title="加斜"></a></li>
   			<li><a id="fontStyleXia" href="#" title="下划线"></a></li>
   			<li><a id="rowCellLeft" href="#" title="居左"></a></li>
			<li><a id="rowCellCenter" href="#" title="居中"></a></li>
			<li><a id="rowCellRight" href="#" title="居右"></a></li>
			<li><a id="rowCellVerticalLevelCenter" href="#" title="垂直居中"></a></li>
			<li><a id="rowCellVerticalLevelLeft" href="#" title="垂直居左"></a></li>
			<li><a id="rowCellVerticalLevelRight" href="#" title="垂直居右"></a></li>
			<li><a id="rowCellDispersedAlignment" href="#" title="分散对齐"></a></li>
			<li><a id="insertCellCol" href="#" title="增加列"></a></li>
			<li><a id="insertCellRow" href="#" title="增加行"></a></li>
			<li><a id="deleteCellCol" href="#" title="删除列"></a></li>
			<li><a id="deleteCellRow" href="#" title="删除行"></a></li>
			<li><a id="mergeCell" href="#" title="合并单元格"></a></li>
			<li><a id="unMergeCell" href="#" title="拆分单元格"></a></li>
	      	
	      	<li><font style="vertical-align:middle;">边框选择：</font>
	      	<select id="selectBorder" style="vertical-align:middle;">
				<option value="1">无线</option>
				<option value="2" selected>细线</option>
				<option value="3">中线</option>
				<option value="4">粗线</option>
				<option value="5">划线</option>
				<option value="6">点线</option>
				<option value="7">点划线</option>
				<option value="8">点点划线</option>
				<option value="9">粗划线</option>
				<option value="10">粗点线</option>
				<option value="11">粗点划线</option>
				<option value="12">粗点点划线</option>
			</select></li>
	      	<li><a id="leftCellBorder" href="#" title="左边框"></a></li>
			<li><a id="rightCellBorder" href="#" title="右边框"></a></li>
			<li><a id="topCellBorder" href="#" title="上边框"></a></li>
			<li><a id="downCellBorder" href="#" title="下边框"></a></li>
			<li><a id="allCellBorder" href="#" title="全网格"></a></li>
			<li><a id="allCellBorderNull" href="#" title="无网格"></a></li>
			<li style="break:break-all"></li>
			<li><font style="vertical-align:middle;">字体：</font>
				<select id="selectFont" style="vertical-align:baseline;">
					<option value="微软雅黑">微软雅黑</option>
					<option value="隶书">隶书</option>
					<option value="宋体">宋体</option>
					<option value="黑体">黑体</option>
					<option value="楷体">楷体</option>
					<option value="仿宋">仿宋</option>
				</select></li>
			<li><font style="vertical-align:middle;"></font>
				<select id="selectFontSize" style="vertical-align:baseline;">
					<option value="6">6</option>
					<option value="8">8</option>
					<option value="9">9</option>
					<option value="10">10</option>
					<option value="11">11</option>
					<option value="12">12</option>
					<option value="14">14</option>
					<option value="16">16</option>
					<option value="18">18</option>
					<option value="20">20</option>
					<option value="22">22</option>
					<option value="24">24</option>
					<option value="26">26</option>
					<option value="28">28</option>
					<option value="30">30</option>
					<option value="32">32</option>
					<option value="34">34</option>
					<option value="36">36</option>
					<option value="48">48</option>
					<option value="72">72</option>
				</select></li>
			<li><a id="chooseTextColor" href="#" title="字体颜色"></a></li>
			<li><a id="exportExcel" href="#" title="导出EXCLE"></a></li>
			<li><a id="importExcel" href="#" title="导入EXCLE"></a></li>
			<li><a id="tool_senior" href="#" title="条件定制"></a></li>
			<li><a id="tool_senior1" href="#" title="计算定制"></a></li>
			<li><a id="tool_senior2" href="#" title="报表校核"></a></li>
			<!-- <li><a id="tool_senior2" href="#" title="报表校核"></a>
				<input type="button" value="报表校核" id="tool_senior2"/>
			</li> -->
			</ul>
	      	
	      </li>
	      <li>
	      		<object id="DCellWeb" style="left: 0px; width: 100%; top: 0px; height: 520px;z-index=-1" codebase="CellWeb5.cab"
                classid="clsid:3F166327-8030-4881-8BD2-EA25350E574A" >
	                <param name="_Version" value="65536" />
	                <param name="_ExtentX" value="10266" />
	                <param name="_ExtentY" value="7011" />
	                <param name="_StockProps" value="0" />
				</object>
	      </li>
	    </ul>
	  </div>
	  <div id="right">
	    <ul id="rig_cen">
	      <li id="rig_header">报表设计</li>
	      <li id="rig_text">
	      	<span  id="rig_text_header"> 区域设置：</span><br />
	      		<table class="rig_table" width="99%" border="0" cellspacing="0" cellpadding="0">
	      			<tr>
	      				<td class="td_grey" width="40%">选择区域属性:</td>
			            <td class="td_grey2" width="60%">
			            	<select id="selectAreaType" style="width:120px" class="selectAreaTypeClass">
								<option value="1" selected>表内</option>
								<option value="2">表外</option>
							</select>
			            </td>
	      			</tr>
	      			<tr>
			            <td class="td_grey" width="40%">选择所属区域:</td>
			            <td class="td_grey2" width="60%">
			            	<select id="reportCategorySelect" style="width:120px" class="reportCategorySelectClass"></select>
			            </td>
			        </tr>
	      			<tr id="areaColTr">
			            <td class="td_grey" width="40%" rowspan="2">设置报表区域:</td>
			            <td class="td_grey2" width="60%">
			            	列：<input type="text" style="width:30px" id="startCol" name="startCol"></input>&nbsp;至&nbsp;<input type="text" style="width:30px" id="endCol" name="endCol"></input>
			            </td>
			        </tr>
			        <tr id="areaRowTr">
			            <td class="td_grey2" width="70%">
			            	行：<input type="text" style="width:30px" id="startRow" name="startRow"></input>&nbsp;至&nbsp;<input style="width:30px" type="text" id="endRow" name="endRow"></input>
			            </td>
			        </tr>
			        <tr>
			            <td class="td_grey" width="100%" colspan="2" align="right">
			            	<table class="rig_table1" width="99%" border="0" cellspacing="0" cellpadding="0">
			            		<tr>
			            			<td class="td_grey" width="100%" colspan="1" align="right">
			            				<input type="button" value="设置" id="setUpReportDataArea"/>
			            			</td>
			            			<td class="td_grey" width="100%" colspan="1" align="right">
			            				<img src="${ctx}/images/report/error.png" width="20px" height="20px" title="注：此处填写的行、列值是报表中的行列值，而不是报表设计器外层的行列值，并且填写的列值必须是大写字母"/>
			            			</td>
			            		</tr>
			            	</table>
			            </td>
			        </tr>
	      		</table>
	      	<span  id="rig_text_header">数据区域明细：</span><br />
	      	<table class="rig_table" width="99%" border="0" cellspacing="0" cellpadding="0" id="reportCategoryTable">
	      		<tr>
		            <td class="td_grey_header" align="center">名称</td>
		            <td class="td_grey_header" align="center">说明</td>
		            <td class="td_grey_header" align="center">操作</td>
		        </tr>
	      	</table>
	      	<span  id="rig_text_header">单元格设置：</span><br />
	      	<table class="rig_table" width="99%" border="0" cellspacing="0" cellpadding="0">
	      		<tr>
		            <td class="td_grey" width="40%">单元格属性：</td>
		            <td class="td_grey2" width="60%">
		            	<select id="selectCellRegionalValue" name="selectCellRegionalValues" class="but" style="width:100px">
						  <option value="0" selected>&mdash;请选择&mdash;</option>
						  <option value="1" >&mdash;自动生成&mdash;</option>
						  <option value="2">&mdash;手动填写&mdash;</option>
						  <option value="3">&mdash;计算&mdash;</option>
						  <option value="4">&mdash;其他&mdash;</option>
						  <option value="5">&mdash;预设&mdash;</option>
						  <option value="6">&mdash;空&mdash;</option>
						</select><br />
		            </td>
		          </tr>
		          <tr id="presetTypeTr" style="display:none">
		            <td class="td_grey" width="40%">预设类型：</td>
		            <td class="td_grey2" width="60%">
		            	<select id="presetTypeSelectValue" name="presetTypeSelectNameValues" class="but" style="width:100px">
						  <option value="0" selected>&mdash;请选择&mdash;</option>
						  <option value="1" >&mdash;填报单位&mdash;</option>
						  <option value="2">&mdash;截止时间&mdash;</option>
						  <option value="3">&mdash;填报时间&mdash;</option>
						  <option value="4">&mdash;起止时间&mdash;</option>
						  <option value="5">&mdash;填报人&mdash;</option>
						</select><br />
		            </td>
		          </tr>
		          <tr>
		            <td class="td_grey" width="40%">是否需要批注</td>
		            <td class="td_grey2" width="60%">
		            	<select id="isNeedCommentId" name="isNeedCommentName" class="but" style="width:100px">
						  <option value="1" selected>&mdash;不需要&mdash;</option>
						  <option value="2">&mdash;需要&mdash;</option>
						</select><br />
		            </td>
		          </tr>
	      	</table>
	      	<!-- <span  id="rig_text_header">条件设置：</span>
	      		<div id="rig_tag">
	      			<ul>
	      				<li class="rig_tag_a">计算公式</li>
			            <li class="rig_tag_hov">校核式</li>
			            <li id="rig_tag_tab">
			            	<table class="rig_table" width="100%" border="0" cellspacing="0" cellpadding="0">
					          <tr>
					            <td class="td_grey" width="40%">文字</td>
					            <td class="td_grey2" width="60%">&nbsp;</td>
					          </tr>
					          <tr>
					            <td class="td_grey">文字</td>
					            <td class="td_grey2">&nbsp;</td>
					          </tr>
					          <tr>
					            <td class="td_grey">文字</td>
					            <td class="td_grey2">&nbsp;</td>
					          </tr>
					          <tr>
					            <td class="td_grey">文字</td>
					            <td class="td_grey2">&nbsp;</td>
					          </tr>
					        </table>
			            </li>
	      			</ul>
	      		</div> -->
		  </li>
	    </ul>
	  </div>
	</div>
	
<!-- 行列条件的DIV -->
<div
  id="pop-up" class="hanglietiaojian"
  style="background-color:#F7F7F7;
    margin:0px;position:absolute;top:26%; left:10%; width:80%;height:68%;padding:4px; display:none; z-index:100;overflow-y:scroll">
<%@ include file="/WEB-INF/jsp/report-design/report-template-conditions.jsp"%>
</div>
 <iframe
  id="DivShim1" class="hanglietiaojianFrame"
  scrolling="no"
  frameborder="0"
  style="position:absolute; top:0px; left:0px; display:none;filter=progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);">
 </iframe>
<!-- 单元格条件的DIV -->
<div
  id="danyuange" class="danyuangetiaojian"
  style="background-color:#F7F7F7;
    margin:0px;position:absolute;top:26%; left:10%; width:75%;height:68%;padding:4px; display:none; z-index:100;overflow-y:scroll">
<%@ include file="/WEB-INF/jsp/report-design/report-template-cell-conditions.jsp"%>
</div>
 <iframe
  id="DivShim2" class="danyuangetiaojianFrame"
  scrolling="no"
  frameborder="0"
  style="position:absolute; top:0px; left:0px; display:none;filter=progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);">
 </iframe>
<!-- 行列计算的DIV -->
<div
  id="hangliejisuan" class="hangliejisuanClass"
  style="background-color:#F7F7F7;
    margin:0px;position:absolute;top:28%; left:20%; width:70%;height:58%;padding:4px; display:none; z-index:100;overflow-y:scroll">
<%@ include file="/WEB-INF/jsp/report-design/report-template-count.jsp"%>
</div>
 <iframe
  id="DivShim3" class="hangliejisuanFrameClass"
  scrolling="no"
  frameborder="0"
  style="position:absolute; top:0px; left:0px; display:none;filter=progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);">
 </iframe>
<!-- 报表校核的DIV -->
<div
  id="hangliejiaohe" class="hangliejiaoheClass"
  style="background-color:#F7F7F7;
    margin:0px;position:absolute;top:18%; left:15%; width:75%;height:68%;padding:4px; display:none; z-index:100;overflow-y:scroll">
<%@ include file="/WEB-INF/jsp/report-design/report-template-validation.jsp"%>
</div>
 <iframe
  id="DivShim4" class="hangliejiaoheFrameClass"
  scrolling="no"
  frameborder="0"
  style="position:absolute; top:0px; left:0px; display:none;filter=progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);">
 </iframe>
</body>


<script type="text/javascript">
//页面加载后，加载报表数据区域的所有单元格属性
function onloadCellType(templateId){
	$.ajax({
		url:'${ctx}/reportDesignController/queryReportAndCellType/' + templateId,
		type:'POST',
		cache:false,
		success:function(data){
			if(data != "" && data != null){
				$.each(data,function(idx,item){
					var key = item.absColNum + "--" + item.absRowNum;
					
					if(item.quoteType == null){
						var celldatatype = new Celldatatype(item.absColNum,item.absRowNum,item.relColNum,item.relRowNum,item.cellType,"",item.isComment,item.areaType);
					}else{
						var celldatatype = new Celldatatype(item.absColNum,item.absRowNum,item.relColNum,item.relRowNum,item.cellType,item.quoteType,item.isComment,item.areaType);
					}
					
					cellAttributeMap.put(key,celldatatype);
				});
			}
			//为了判断cellAttributeMap是否是从数据库读出来的，所以这里赋值，如果是读出来的，在设置报表区域的时候就去做new的操作，否则不做new的操作
			//isDatabaseOnload = true;
		}
	});
}

//页面加载后，加载该张报表的数据区域
function onloadReportAreaTemporary(templateId){
	$.ajax({
		url:'${ctx}/reportDesignController/queryReportAreaTemporary/' + templateId,
		type:'POST',
		cache:false,
		success:function(data){
			if(data != "" && data != null){
				$.each(data,function(idx,item){
					var key = item.id;
					
					var reportCategory = new ReportCategory(item.categoryId,item.categoryName,item.condStartCol,item.condEndCol,item.condStartRow,item.condEndRow,item.templateId,item.absStartCol,item.absEndCol,item.absStartRow,item.absEndRow,item.temporaryDescribe);
					
					reportCategoryMap.put(key,reportCategory);
					
					var tableTr = handleReportCategory(key,item.categoryName,item.temporaryDescribe);
					$("#reportCategoryTable").append(tableTr);
				});
			}
		}
	});
}

$(document).ready(function(){//初始化
	var templateId = $("#templateId").val();
	var annualId = $("#annualId").val();
	
	DCellWeb.OpenFile(ctx+"/reportDesignController/readReportTemplate/"+templateId+"/"+annualId,"");
	DCellWeb.AllowDragdrop="false"; 
	onloadReportCategory();
	onloadReportAreaTemporary(templateId);
	onloadCellType(templateId);
	
	loadDataSet();
	loadDataSetZongKong();
	loadDataSetHang();
	loadDataSetLie();
	jspLoadZongkong();
	jspLoadHang();
	jspLoadLie();
	loadDataItemTimeList();
	loadDataItemUnitList();
	//加载报表校核条件
	getAllTemplateInValidationFormula();
	getAllTemplateName();
 });

//报表行列条件弹出框
$("#tool_senior").click(function(){
	var condStartColValueHidden = $("#condStartColValueHidden").val();
	var condEndColValueHidden = $("#condEndColValueHidden").val();
	var condStartRowValueHidden = $("#condStartRowValueHidden").val();
	var condEndRowValueHidden = $("#condEndRowValueHidden").val();
	if(condStartColValueHidden == "" || condEndColValueHidden == "" || condStartRowValueHidden == "" || condEndRowValueHidden == ""){
		alert("请先设置数据区域");
		return false;
	}
	DivSetVisibleCond(true);
});

//报表行列计算的弹出框
$("#tool_senior1").click(function(){
	var condStartColValueHidden = $("#condStartColValueHidden").val();
	var condEndColValueHidden = $("#condEndColValueHidden").val();
	var condStartRowValueHidden = $("#condStartRowValueHidden").val();
	var condEndRowValueHidden = $("#condEndRowValueHidden").val();
	if(condStartColValueHidden == "" || condEndColValueHidden == "" || condStartRowValueHidden == "" || condEndRowValueHidden == ""){
		alert("请先设置数据区域");
		return false;
	}
	DivSetVisibleCount(true);
	loadCountFormula();
});

$("#but_close").click(function(){
	DivSetVisibleCond(false);
});

$("#but_close_cell").click(function(){
	DivSetVisibleCellCond(false);
});

function closeCountDiv(){
	$("#aRowCountFormula").text("");
	DivSetVisibleCount(false);
}

//报表行列校核
$("#tool_senior2").click(function(){
	DivSetVisibleValidation(true);
	$("#aRowValidationFormula").val("");
	$("#aColValidationFormula").val("");
	$("#aCellValidationFormula").val("");
});
</script>
</html>